home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 573 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  45 lines

  1. Path: news.deltanet.com!usenet
  2. From: olivas@deltanet.com (Sergio Olivas)
  3. Newsgroups: comp.lang.c++
  4. Subject: Are Pure Functions always Virtual????
  5. Date: Fri, 05 Jan 1996 08:01:23 GMT
  6. Organization: Delta Internet Services, Anaheim, CA
  7. Message-ID: <4cilse$5li@news2.deltanet.com>
  8. NNTP-Posting-Host: ana2066.deltanet.com
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11.  
  12. I have a base class for accessing databases (BC++), the base class is
  13. made of only pure virtual functions.  Two derived classes are written,
  14. one for accessing databases through the Paradox Engine, the other
  15. using the Borland Database Engine.
  16.  
  17. Since I've heard that using virtual functions really eats into the 64k
  18. automatic data segment, as well as adding overhead, is the 'virtual'
  19. keyword really needed. -- and does it make any difference, assuming
  20. I'm not going to further derive another class from the newly derived
  21. class (in this case DB_BASE_PDX) ???
  22.  
  23. eg..
  24.   class DB_BASE {
  25. {  ...
  26.    virtual int NextRecord(int TableID) = 0;
  27.   ..^^^^^ is this needed?
  28.  };
  29.  
  30. The derived classes are something like
  31.   class DB_BASE_PDX : public DB_BASE
  32.   {
  33.     ...
  34.      int NextRecord(int TableID);
  35.    ...
  36.    }
  37.  
  38. Thanks,
  39.    Sergio Olivas
  40.  
  41.  
  42.  
  43.      
  44.  
  45.